package com.yyfax.infrastructure.upgrade;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by HenryZhang on 2016/11/23.
 * Copyright © 2016 www.yyfax.com. All Rights Reserved.
 */
public class ResourceUtil {
    private static final String FILE_NAME = "infrastructure_update";

    public static int getResourceId(Context ctx, String rsName) {
		return ctx.getResources().getIdentifier(rsName, "drawable", ctx.getPackageName());
	}

    public static SharedPreferences getGlobalSharedPreferences(Context ctx) {
        return ctx.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE);
    }

    public static SharedPreferences.Editor getGlobalSharedPreferencesEditor(Context ctx) {
        SharedPreferences sp = getGlobalSharedPreferences(ctx);
        return sp.edit();
    }
}
